package main

import (
	"net/http"

	"github.com/gin-gonic/gin"
)

func main() {

	gin.SetMode(gin.DebugMode)
	g := gin.Default()

	g.LoadHTMLFiles("static/index.html")
	g.Static("/static", "./static")

	g.GET("/", func(c *gin.Context) {
		c.HTML(http.StatusOK, "index.html", nil)
	})

	g.POST("/shorten", shortenURL)

	g.GET("/:shorturl", redirectURL)

	g.Run(":8080")
}
